var Koa = require("koa");
var router = require("koa-router")();
var render = require("koa-art-template");
var path = require("path");
var Bodyparser = require("koa-bodyparser");
var DB = require("./module/db");

var app = new Koa();

app.use(Bodyparser());

//配置模板引擎
render(app, {
    root: path.join(__dirname, 'views'),
    extname: '.html',
    debug: process.env.NODE_ENV != 'production'
});

router.get("/", async (ctx) => {
    ctx.body = "首页";
});

//启动路由
app
    .use(router.routes())
    .use(router.allowedMethods())

app.listen(3000);
